<?php
/**********************************************************
** Lime Manager
** Thomas Knobloch & Clément Troesch
** Administrator Links Ajax View
***********************************************************/
?>

<?php include_once "../../model/AdministratorModel.php"; ?>
<?php include_once "../../model/SessionModel.php"; ?>
<?php session_start(); ?>

<div class="section_title" id="links"><h1> Liens </h1></div>
<div class="section_info">
	Obtention des liens vers les autres bases de données. 
</div>

<div class="article">

<?php
if(isset($_SESSION['session']->userLogin)){
?>
	<div class="tableContainer">
		<table class="tableQueryCenter">
			<tr>
				<th>Propriétaire</th>
				<th>Nom</th>
				<th>Utilisateur</th>
				<th>Host</th>
				<th>Date de création</th>
			</tr>
		<?php

		$nbrow = AdministratorModel::getLinksInfos($_SESSION['session']->currentConnection, $result);
			foreach ($result as $row) {
				echo "<tr>";
				echo "<td>".$row['OWNER']."</td>\n";
				echo "<td>".$row['DB_LINK']."</td>\n";
				echo "<td>".$row['USERNAME']."</td>\n";
				echo "<td>".$row['HOST']."</td>\n";
				echo "<td>".$row['CREATED']."</td>\n";
				echo"</tr>";
			}
		}	
		?>
		</table>
	</div>
</div>
